/**
 * 最小公共值
 *
 * @USER: Administrator
 * @DATE: 2024/9/27 下午11:55
 * @VERSION: 1.0.0
 */
public class LC2540 {
    public static void main(String[] args) {

    }

    public int getCommon(int[] nums1, int[] nums2) {
        int start = 0;
        for (int i = 0; i < nums1.length; i++) {
            for (int j = start; j < nums2.length; j++) {
                if (nums1[i] == nums2[j]) {
                    return nums1[i];
                }else if(nums1[i] < nums2[j]){
                    start = j;
                    break;
                }
            }
        }
        return -1;
    }

}
